using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace DriverSVH
{
    public struct SVHControllerState
    {
        //! Fault indication of the controllers (0x001F -> high bit to reset software state. 0x00 -> low bit to reset hardware)
        //! \note The Faults are not yet mapped to channels directly so the information should only be treated as a fault/no fault
        public ushort pwm_fault;
        //! Over Temperature Warning of the controllers (0x001F -> high bit to reset software state. 0x00 -> low bit to reset hardware)
        //! \note The Faults are not yet mapped to channels directly so the information should only be treated as a fault/no fault
        public ushort pwm_otw;
        //! Bitmask for low-active resets of the channels (0-8). Channel 9 (0x0200) is a special channel that activates a 12VDV-DV converter for the small motors.
        public ushort pwm_reset;
        //! Currently unused but should be called the same way as pwm_reset is
        //! \note This flag is currently unused by the hardware but should be handled exactly the same as pwm reset at the moment
        public ushort pwm_active;
        //! Enable/Disable of position controller (0x0001 to Activate )
        public ushort pos_ctrl;
        //! Enable/Disbale of current controller (0x0001 to Activate)
        public ushort cur_ctrl;

        public SVHControllerState(ushort _pwm_fault, ushort _pwm_otw, ushort _pwm_reset, ushort _pwm_active, ushort _pos_ctrl, ushort _cur_ctrl)
        {
            pwm_fault = _pwm_fault;
            pwm_otw = _pwm_otw;
            pwm_reset = _pwm_reset;
            pwm_active = _pwm_active;
            pos_ctrl = _pos_ctrl;
            cur_ctrl = _cur_ctrl;
        }
    }

}
